{% extends "users/settings/base.html" %}

{% block title %}
	密保设置
{% endblock %}

{% block edit %}
	<div class="row">
		<div class="col-sm-8 settings-content">
			<form class="form-horizontal" role="form" action="{% url 'users:safety-security-question' request.user.id %}" method="post">
				<!--防止恶意攻击-->
				{% csrf_token %}
				<!--密保问题-->
				<div class="form-group">
					<label class="col-sm-2 control-label">问题：</label>
					<div class="col-sm-10">
						{% if user.question %}
							<input type="text" name="question" class="form-control" placeholder="请输入密保问题" value="{{ user.question }}"/>
						{% else %}
							<input type="text" name="question" class="form-control" placeholder="请输入密保问题" value="{{ question }}"/>
						{% endif %}
					</div>
				</div>
        <br/>
				<!--密保问题-->
				<div class="form-group">
					<label class="col-sm-2 control-label">答案：</label>
					<div class="col-sm-10">
						{% if user.answer %}
							<input type="text" name="answer" class="form-control" placeholder="请输入答案" value="{{ user.answer }}"/>
						{% else %}
							<input type="text" name="answer" class="form-control" placeholder="请输入答案" value="{{ answer }}"/>
						{% endif %}
					</div>
				</div>
        <hr/>
				<!--保存按钮-->
				<button type="submit" class="btn btn-primary pull-right visible-sm visible-md visible-lg">保存</button>
				<button type="submit" class="btn btn-primary btn-block visible-xs">保存</button>
			</form>
		</div>
	</div>
{% endblock %}